import java.util.Scanner;
class Student{
    protected String name;
    protected int age;
    void Student(String name,int age){
        this.name=name;
        this.age=age;
    }
    void show(){
        System.out.println("Student[name="+name+",age="+age+"]");
    }
}
class Undergraduate extends Student{
    private String major;
    void Undergraduate(String name,int age,String major){
        super.Student(name,age);
        this.major=major;
    }
    void show(){
        System.out.println("Undergraduate[name="+name+",age="+age+",major="+major+"]");
    }
}
public class Kaoshi1 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        Student object1=new Student();
        Undergraduate object2=new Undergraduate();
        object1.Student(scanner.next(),scanner.nextInt());
        object2.Undergraduate(scanner.next(),scanner.nextInt(),scanner.next());
        object1.show();
        object2.show();
    }
}
